import { Callout } from '@theguild/components'

# SafeInt

This scalar behaves just like the native `GraphQLInt` scalar, but it allows integers that require
more than 32-bits. Any integer that is considered "safe" in JavaScript (i.e. ±
`9,007,199,254,740,991`) is considered a valid value. But if you need more than 52-bits, you should
use `BigInt`.

The [GraphQL spec](https://facebook.github.io/graphql/#sec-Int) limits its Int type to 32-bits.
Maybe you've seen this error before:
[issue on graphql-js](https://github.com/graphql/graphql-js/issues/292).

<Callout>
  Based on [graphql-bigint](https://github.com/stems/graphql-bigint). Even though stems'
  implementation looks the same as the `BigInt` scalar, it is different because our `BigInt`
  implementation uses JavaScript's native `BigInt` type while `SafeInt` implementation doesn't
  support more than 52-bit integers.
</Callout>
